package indi.mozping.endthread;

/**
 * @author by mozping
 * @Classname EndThread
 * @Description TODO
 * @Date 2019/4/25 10:52
 */
public class EndThread {

    static class MyThread extends Thread {

        @Override
        public void run() {

//            try {
//                while (!this.isInterrupted()) {
//                    System.out.print("子线程运行...");
//                }
//                System.out.println("Thread TestThread is interrupted  ...");
//            }catch (InterruptedException e){
//                System.err.println("子线程捕获到了异常...");
//            }


        }
    }


    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new MyThread();
        t1.start();
        //让子线程运行起来
        Thread.sleep(1000);

    }
}
